package com.w7vm.menuweb.entity;

import java.io.Serializable;
import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the RestauranteFilialWeb database table.
 * 
 */
@Entity
@NamedQueries({
	
	// Perfil ADM CONTA
	@NamedQuery(name="Filial.findFilialByIDMatriz",
					query="SELECT rf" +
					" FROM RestauranteFilialWeb rf" +
					" JOIN rf.restauranteSedeWeb r " +
					" WHERE r.idRestauranteSedeWeb = :idRestaurante" +
					" AND rf.status = 1"),
					
	@NamedQuery(name="Filial.findFilialByID",
					query="SELECT rf" +
					" FROM RestauranteFilialWeb rf" +
					" JOIN rf.restauranteFilialEnderecoWebs fend " +
					" JOIN rf.restauranteFilialInfraestruturaWebs finf " +
					" JOIN rf.restauranteFilialJuridicoWeb fjur " +
					" WHERE rf.idRestauranteFilialWeb = :idRestaurante"),

	@NamedQuery(name="Filial.findFilialByCNPJ", 
					query="SELECT rf" +
							" FROM RestauranteFilialWeb rf" +
							" JOIN rf.restauranteFilialJuridicoWeb j" +
							" WHERE j.cnpj = :cnpj"),
							
})

public class RestauranteFilialWeb implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final String FIND_FILIAL_BY_IDMATRIZ = "Filial.findFilialByIDMatriz";
	public static final String FIND_FILIAL_BY_ID = "Filial.findFilialByID";
	public static final String FIND_FILIAL_BY_CNPJ = "Filial.findFilialByCNPJ";

	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int idRestauranteFilialWeb;


    @Temporal( TemporalType.DATE)
	@Column(name="DataInc")
	private Date dataInc;

    @Temporal( TemporalType.DATE)
	@Column(name="DtAlt")
	private Date dtAlt;

	@Column(name="Fone1")
	private String fone1;

	@Column(name="Fone2")
	private String fone2;

	@Column(name="Mail")
	private String mail;

	@Column(name="Proprietario")
	private String proprietario;

	@Column(name="Status")
	private int status;

	@Column(name="Image")
	private String image;

	//bi-directional many-to-one association to ContratoRestaurantesWeb
	@OneToMany(mappedBy="restauranteFilialWeb")
	private Set<ContratoRestaurantesWeb> contratoRestaurantesWebs;

	//bi-directional many-to-one association to AcessoWeb
	@OneToMany(mappedBy="restauranteFilialWeb")
	private Set<AcessoWeb> acessoWebs;

	//bi-directional many-to-one association to CardapioBuffetWeb
	@OneToMany(mappedBy="restauranteFilialWeb")
	private Set<CardapioBuffetWeb> cardapioBuffetWebs;

	//bi-directional many-to-one association to CardapioInfantilWeb
	@OneToMany(mappedBy="restauranteFilialWeb")
	private Set<CardapioInfantilWeb> cardapioInfantilWebs;

	//bi-directional many-to-one association to CardapioLaCarteWeb
	@OneToMany(mappedBy="restauranteFilialWeb")
	private Set<CardapioLaCarteWeb> cardapioLaCarteWebs;

	//bi-directional many-to-one association to CardapioSelfServiceWeb
	@OneToMany(mappedBy="restauranteFilialWeb")
	private Set<CardapioSelfServiceWeb> cardapioSelfServiceWebs;

	//bi-directional many-to-one association to RestauranteFilialEnderecoWeb
	@OneToMany(mappedBy="restauranteFilialWeb", cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private Set<RestauranteFilialEnderecoWeb> restauranteFilialEnderecoWebs;

	//bi-directional many-to-one association to RestauranteFilialInfraestruturaWeb
	//@OneToMany(mappedBy="restauranteFilialWeb", cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@OneToMany(mappedBy="restauranteFilialWeb",fetch=FetchType.EAGER, cascade=CascadeType.ALL, orphanRemoval=true)
	private Set<RestauranteFilialInfraestruturaWeb> restauranteFilialInfraestruturaWebs;

	//bi-directional one-to-one association to RestauranteFilialJuridicoWeb
	@OneToOne(mappedBy="restauranteFilialWeb", cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="idRestauranteFilialWeb")
	private RestauranteFilialJuridicoWeb restauranteFilialJuridicoWeb;

	//bi-directional many-to-one association to CardapioEspecialidadeWeb
	@OneToMany(mappedBy="restauranteFilialWeb")
	private Set<CardapioEspecialidadeWeb> cardapioEspecialidadeWebs;

	//bi-directional many-to-one association to RestauranteCulinariaSy
    @ManyToOne
	@JoinColumn(name="idRestauranteCulinaria")
	private RestauranteCulinariaSy restauranteCulinariaSy;

	//bi-directional many-to-one association to RestauranteSedeWeb
    @ManyToOne
	@JoinColumn(name="idRestauranteSede")
	private RestauranteSedeWeb restauranteSedeWeb;

	//bi-directional many-to-one association to RestauranteServicoSy
    @ManyToOne
	@JoinColumn(name="idRestauranteServico")
	private RestauranteServicoSy restauranteServicoSy;

	//bi-directional many-to-one association to RestauranteTipoSy
    @ManyToOne
	@JoinColumn(name="idRestauranteTipo")
	private RestauranteTipoSy restauranteTipoSy;

    public RestauranteFilialWeb() {
    }

	public int getIdRestauranteFilialWeb() {
		return this.idRestauranteFilialWeb;
	}

	public void setIdRestauranteFilialWeb(int idRestauranteFilialWeb) {
		this.idRestauranteFilialWeb = idRestauranteFilialWeb;
	}

	public Date getDataInc() {
		return this.dataInc;
	}

	public void setDataInc(Date dataInc) {
		this.dataInc = dataInc;
	}

	public Date getDtAlt() {
		return this.dtAlt;
	}

	public void setDtAlt(Date dtAlt) {
		this.dtAlt = dtAlt;
	}

	public String getFone1() {
		return this.fone1;
	}

	public void setFone1(String fone1) {
		this.fone1 = fone1;
	}

	public String getFone2() {
		return this.fone2;
	}

	public void setFone2(String fone2) {
		this.fone2 = fone2;
	}

	public String getMail() {
		return this.mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getProprietario() {
		return this.proprietario;
	}

	public void setProprietario(String proprietario) {
		this.proprietario = proprietario;
	}

	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Set<AcessoWeb> getAcessoWebs() {
		return this.acessoWebs;
	}

	public void setAcessoWebs(Set<AcessoWeb> acessoWebs) {
		this.acessoWebs = acessoWebs;
	}
	
	public Set<CardapioBuffetWeb> getCardapioBuffetWebs() {
		return this.cardapioBuffetWebs;
	}

	public void setCardapioBuffetWebs(Set<CardapioBuffetWeb> cardapioBuffetWebs) {
		this.cardapioBuffetWebs = cardapioBuffetWebs;
	}
	
	public Set<CardapioInfantilWeb> getCardapioInfantilWebs() {
		return this.cardapioInfantilWebs;
	}

	public void setCardapioInfantilWebs(Set<CardapioInfantilWeb> cardapioInfantilWebs) {
		this.cardapioInfantilWebs = cardapioInfantilWebs;
	}
	
	public Set<CardapioLaCarteWeb> getCardapioLaCarteWebs() {
		return this.cardapioLaCarteWebs;
	}

	public void setCardapioLaCarteWebs(Set<CardapioLaCarteWeb> cardapioLaCarteWebs) {
		this.cardapioLaCarteWebs = cardapioLaCarteWebs;
	}
	
	public Set<CardapioSelfServiceWeb> getCardapioSelfServiceWebs() {
		return this.cardapioSelfServiceWebs;
	}

	public void setCardapioSelfServiceWebs(Set<CardapioSelfServiceWeb> cardapioSelfServiceWebs) {
		this.cardapioSelfServiceWebs = cardapioSelfServiceWebs;
	}
	
	public Set<RestauranteFilialEnderecoWeb> getRestauranteFilialEnderecoWebs() {
		return this.restauranteFilialEnderecoWebs;
	}

	public void setRestauranteFilialEnderecoWebs(Set<RestauranteFilialEnderecoWeb> restauranteFilialEnderecoWebs) {
		this.restauranteFilialEnderecoWebs = restauranteFilialEnderecoWebs;
	}
	
	public Set<RestauranteFilialInfraestruturaWeb> getRestauranteFilialInfraestruturaWebs() {
		return this.restauranteFilialInfraestruturaWebs;
	}

	public void setRestauranteFilialInfraestruturaWebs(Set<RestauranteFilialInfraestruturaWeb> restauranteFilialInfraestruturaWebs) {
		this.restauranteFilialInfraestruturaWebs = restauranteFilialInfraestruturaWebs;
	}
	
	public RestauranteFilialJuridicoWeb getRestauranteFilialJuridicoWeb() {
		return this.restauranteFilialJuridicoWeb;
	}

	public void setRestauranteFilialJuridicoWeb(RestauranteFilialJuridicoWeb restauranteFilialJuridicoWeb) {
		this.restauranteFilialJuridicoWeb = restauranteFilialJuridicoWeb;
	}
	
	public RestauranteCulinariaSy getRestauranteCulinariaSy() {
		return this.restauranteCulinariaSy;
	}

	public void setRestauranteCulinariaSy(RestauranteCulinariaSy restauranteCulinariaSy) {
		this.restauranteCulinariaSy = restauranteCulinariaSy;
	}
	
	public RestauranteSedeWeb getRestauranteSedeWeb() {
		return this.restauranteSedeWeb;
	}

	public void setRestauranteSedeWeb(RestauranteSedeWeb restauranteSedeWeb) {
		this.restauranteSedeWeb = restauranteSedeWeb;
	}
	
	public RestauranteServicoSy getRestauranteServicoSy() {
		return this.restauranteServicoSy;
	}

	public void setRestauranteServicoSy(RestauranteServicoSy restauranteServicoSy) {
		this.restauranteServicoSy = restauranteServicoSy;
	}
	
	public RestauranteTipoSy getRestauranteTipoSy() {
		return this.restauranteTipoSy;
	}

	public void setRestauranteTipoSy(RestauranteTipoSy restauranteTipoSy) {
		this.restauranteTipoSy = restauranteTipoSy;
	}
	
	public Set<CardapioEspecialidadeWeb> getCardapioEspecialidadeWebs() {
		return this.cardapioEspecialidadeWebs;
	}

	public void setCardapioEspecialidadeWebs(Set<CardapioEspecialidadeWeb> cardapioEspecialidadeWebs) {
		this.cardapioEspecialidadeWebs = cardapioEspecialidadeWebs;
	}

	public Set<ContratoRestaurantesWeb> getContratoRestaurantesWebs() {
		return this.contratoRestaurantesWebs;
	}

	public void setContratoRestaurantesWebs(Set<ContratoRestaurantesWeb> contratoRestaurantesWebs) {
		this.contratoRestaurantesWebs = contratoRestaurantesWebs;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}



}